let ResponseUtils = require("../utils/ResponseUtils");
let OrderService = require("../service/order");

/**
 * 城市控制器
 */
class OrderController {
    static async list(ctx) {
        let result = await OrderService.list(ctx.query.type);
        ctx.body = ResponseUtils.builder(result).success().build();
    }
    static async create(ctx) {
        let result = await OrderService.create(ctx.request.body,ctx.currentUser);
        ctx.body = ResponseUtils.builder(result).success().build();
    }
    static async adminList(ctx) {
        let result = await OrderService.adminList(ctx.query.type,ctx.query.page);
        ctx.body = ResponseUtils.builder(result).success().build();
    }
}

module.exports = OrderController;
